﻿@using ETD.Common.Extension;
@using ETD.WebOrganization.Libs.Helper;
@using ETD.WinClient.Config;
@using ETD.Domain.EnumModels;
@using ETD.Domain.WebModels;
@using ETD.Common;
@model ETD.WebOrganization.Areas.Web.Models.TodayTaskModel
@{
    ViewBag.Title = "今日任务";
}
@{

    var wpSecurityItemNotCheckList = Model.WpSecurityItemList.Where(x => x.WpSecurityItemStatusID == (int)EWpSecurityItemStatus.NotCheck).ToList();
    var wpSecurityItemCheckPassList = Model.WpSecurityItemList.Where(x => x.WpSecurityItemStatusID == (int)EWpSecurityItemStatus.CheckPass).ToList();
    var wpSecurityItemCheckNotPassList = Model.WpSecurityItemList.Where(x => x.WpSecurityItemStatusID == (int)EWpSecurityItemStatus.CheckNotPass).ToList();
}
<style>
    .color_Qualified {
        color: #4cd964 !important;
    }

    .color_Unqualified {
        color: #f60 !important;
    }

    .weui-center {
        text-align: center;
    }
</style>
<div class="weui-tab">
    <div class="weui-navbar">
        <a class="weui-navbar__item weui-bar__item--on" href="#tab1">
            待检验(@wpSecurityItemNotCheckList.Count)
        </a>
        <a class="weui-navbar__item color_Qualified" href="#tab2">
            合格(@wpSecurityItemCheckPassList.Count)
        </a>
        <a class="weui-navbar__item color_Unqualified" href="#tab3">
            不合格(@wpSecurityItemCheckNotPassList.Count)
        </a>
    </div>
    <div class="weui-tab__bd">
        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
            @if (wpSecurityItemNotCheckList.Count > 0)
            {
                <div class="weui-cells">
                    @for (int iSecurityCheckItem = 0; iSecurityCheckItem < wpSecurityItemNotCheckList.Count; iSecurityCheckItem++)
                {
                    var securityCheckItem = wpSecurityItemNotCheckList[iSecurityCheckItem];
                        <a class="weui-cell weui-cell_access" href="@Url.Action("WpSecurityItem", "Security")?WpSecurityItemID=@securityCheckItem.WpSecurityItemID">
                            <div class="weui-cell__hd">
                                ⊙&nbsp;&nbsp;
                            </div>

                            <div class="weui-cell__bd">
                                <p>@securityCheckItem.HiddenDangerContent</p>
                            </div>
                            <div class="weui-cell__ft">
                            </div>
                        </a>
                    }
                </div>
            }
            else
            {
                <div class="weui-panel__hd weui-center">无安检表</div>
            }
        </div>
        <div id="tab2" class="weui-tab__bd-item">
            @if (wpSecurityItemCheckPassList.Count > 0)
            {
                <div class="weui-cells">
                    @for (int iSecurityCheckItem = 0; iSecurityCheckItem < wpSecurityItemCheckPassList.Count; iSecurityCheckItem++)
                {
                    var securityCheckItem = wpSecurityItemCheckPassList[iSecurityCheckItem];
                        <a class="weui-cell weui-cell_access" href="@Url.Action("WpSecurityItem", "Security")?WpSecurityItemID=@securityCheckItem.WpSecurityItemID">
                            <div class="weui-cell__hd">
                                ⊙&nbsp;&nbsp;
                            </div>

                            <div class="weui-cell__bd">
                                <p>@securityCheckItem.HiddenDangerContent</p>
                            </div>
                            <div class="weui-cell__ft">
                            </div>
                        </a>
                    }
                </div>
            }
            else
            {
                <div class="weui-panel__hd weui-center">无安检表</div>
            }
        </div>
        <div id="tab3" class="weui-tab__bd-item">
            @if (wpSecurityItemCheckNotPassList.Count > 0)
            {
                <div class="weui-cells">
                    @for (int iSecurityCheckItem = 0; iSecurityCheckItem < wpSecurityItemCheckNotPassList.Count; iSecurityCheckItem++)
                {
                    var securityCheckItem = wpSecurityItemCheckNotPassList[iSecurityCheckItem];
                        <a class="weui-cell weui-cell_access" href="@Url.Action("WpSecurityItem", "Security")?WpSecurityItemID=@securityCheckItem.WpSecurityItemID">
                            <div class="weui-cell__hd">
                                ⊙&nbsp;&nbsp;
                            </div>

                            <div class="weui-cell__bd">
                                <p>@securityCheckItem.HiddenDangerContent</p>
                            </div>
                            <div class="weui-cell__ft">
                            </div>
                        </a>
                    }
                </div>
            }
            else
            {
                <div class="weui-panel__hd weui-center">无安检表</div>
            }
        </div>

    </div>
</div>
@section ScriptSection{
    <script>
        $(function () {

        });

        function vote(eventElement, id) {
            var paras = {};
            paras.ParticipantID = id;
            ajaxPost("@Url.Action("Toupiao","Lianmeng")", paras, function (data) {
                console.log(data);
                if (data.Status) {
                    $(eventElement).find(".touPiaoTimesSpan").text("赞:" + data.Data.TouPiaoTimes);
                    showAutoCloseDialog("投票成功", "", 3000);
                } else {
                    showAutoCloseDialog(data.Info, "", 3000);

                }
            });
        }


    </script>
}